version 11.0

*     ***************************************************************** *
*      Change path (below) as appropriate                               *
*     ***************************************************************** *
log using "C:\Sona\France\portfolio_replication.log", replace

#delimit ;

*     ***************************************************************** *;
*     ***************************************************************** *;
*       File-Name:      portfolio_replication.do                        *;
*       Date:           August 7, 2012                                  *;
*       Author:         SNG/JT                                          *;
*       Purpose:      	Gamson's Law Paper                              *;
*       Input File:     portfolioGT.dta                                 *;
*       Output File:    portfolio_replication.log                       *;
*       Data Output:    none                                            *;
*       Previous file:  regional_analyses9.do                           *;
*       Machine:        PSU Dell laptop                                 *;
*     ****************************************************************  *;
*     ****************************************************************  *;

set mem 400m;


*     ***************************************************************** *;
*      Change path (below) as appropriate                               *;
*     ***************************************************************** *;

use "C:\Sona\France\portfolioGT.dta", clear;

*     ****************************************************************  *;
*       Produce basic graph for Figure 1.  Note that "portfolioshare"   *;
*       was "ppunwtd" and "seatshare" was "ptyprop" in the original     *;
*       Warwick and Druckman (2006) data, which is what is used here    *;
*       to create this figure                                           *;
*     ****************************************************************  *;

gen y=(_n-1)/10;

gen x=(_n-1)/10;

graph twoway  scatter portfolioshare seatshare  if name!="Regions_France", msymbol(oh) mcolor(gray) msize(1.5) 
    || lfit portfolioshare seatshare if name!="Regions_France", clpattern(shortdash) clcolor(black) 
    || line  y x if y<1.1 & x<1.1, legend(off) clcolor(black) clwidth(0.5) scheme(s1mono);
    
*     ****************************************************************  *;
*      Produce results for Models 1-8, Table 1                          *;
*     ****************************************************************  *;

keep if france==1;

*     ****************************************************************  *;
*       Party Size Hypothesis (Models 1-4)                              *;
*     ****************************************************************  *;

regress portfolioshare seatshare if regional==0,  vce(cluster caseno);
regress portfolioshare seatshare if regional==1,  vce(cluster caseno);
regress portfolioshare seatshare regional seatshare_regional,  vce(cluster caseno);
regress portfolioshare seatshare regional seatshare_regional region2004 region2010,  vce(cluster caseno);

*     ****************************************************************  *;
*       Formateur Hypothesis (Models 5-8)                               *;
*     ****************************************************************  *;

regress portfolioshare seatshare formateur if regional==0,  vce(cluster caseno);
regress portfolioshare seatshare formateur if regional==1,  vce(cluster caseno);
regress portfolioshare seatshare formateur regional regional_formateur, vce(cluster caseno);
regress portfolioshare seatshare formateur regional regional_formateur region2004 region2010, vce(cluster caseno);


*     ****************************************************************  *;
*           Auxilary analyses                                           *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*       recode formateur variable to code Pompidou as independent       *;
*       (nonpartisan), as was the case in the original Warwick and      *;
*       Druckman (2006) dataset                                         *;
*     ****************************************************************  *;

gen formateurPI = formateur ;

replace formateurPI =0 if caseno == 531 & party==17;
replace formateurPI = 0 if caseno == 532 & party==17;
replace formateurPI =0 if caseno == 533 & party==17;
replace formateurPI =0 if caseno == 534 & party==17;

gen regional_formateurPI =  regional * formateurPI;

*     ****************************************************************  *;
*       Formateur Hypothesis (auxillary Models 9-12)                    *;
*     ****************************************************************  *;

regress portfolioshare seatshare formateurPI if regional==0,  vce(cluster caseno);
regress portfolioshare seatshare formateurPI if regional==1,  vce(cluster caseno);
regress portfolioshare seatshare formateurPI regional regional_formateurPI, vce(cluster caseno);
regress portfolioshare seatshare formateurPI regional_formateurPI region2004 region2010, vce(cluster caseno);


*     ****************************************************************  *;
*       The End                                                         *;
*     ****************************************************************  *;

log close;
